<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title>问题反馈</title>
    <link rel="stylesheet" href="../css/mui.min.css">
    <script src="../js/mui.min.js"></script>
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="../css/app.css" />
    <link rel="stylesheet" href="../npl/css/vant.mini.css" />
    <script src="../js/vconsole.min.js"></script>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../js/flexible.js"></script>
    <script src="../wx/uap.js"></script>
    <script src="./text.js" type="text/javascript"></script>
    <script src="../npl/js/vant.mini.js"></script>
    <script src="../js/sm3.js"></script>
    <script src="../js/sm2.js"></script>
</head>
<style>
    body {
        margin: 0;
        padding: 0;
    }

    .form-box {
        padding: 10px 15px;
    }

    .van-cell--required::before {
        left: .26rem;
    }

    .form-box .van-cell {
        border-radius: 7px;
        align-items: center;
        padding: 0 .4rem;
    }

    .form-box .van-cell.van-field--min-height {
        padding: 10px 16px;
    }

    .form-box .van-field--disabled .van-field__label {
        color: #646566;
    }

    .form-box input[type=text] {
        border: none;
        margin-bottom: 0;
        padding: 0;
    }

    .foot {
        display: flex;
        justify-content: center;
        width: 100%;
        position: absolute;
        bottom: .21rem;
        left: 0;
        width: 100%;
    }

    .foot_wrapper {
        font-family: PingFang SC;
        color: #2d343c;
        font-size: 12px;
        opacity: 60%;
        width: 100%;
        text-align: center;
        padding: 0 10px;
    }

    .van-nav-bar {
        background: none !important;
        ;
    }

    .header_upload1 {
        /* padding: 0 24px; */
        /* height: 2.8rem; */
        position: relative;
    }

    .upload_wrapper1 {
        width: 100%;
        /* max-height: calc(2.7rem - 27px); */
        margin: auto;
        /* padding-left: 8px; */
        overflow-y: scroll;
        /* padding: 5px 0px 0; */
        /* margin: 10px 0 0 10px; */
    }

    .text_title {
        /* height: 30px; */
        /* padding: 0% 0% 0% 4%; */
        position: relative;
        /* border-bottom: 1px solid #8a9dbe; */
        /* background:turquoise; */
        /* line-height: 30px;         */
    }

    .first_span {
        width: 3px;
        border-radius: 20% 20%;
        display: inline-block;
        height: 15px;
        background: #4294f1;
    }

    .first_span_text {
        font-weight: 500;
        font-size: 15px;
        color: #1e3754;
        /* position: absolute; */
        /* left: 7%; */
        /* top: 11%; */
    }

    .first_span_img {
        /* position: absolute;
        left: 25%;
        top: 36%; */
        margin-left: 3px;
        color: red;
    }

    .numImg {
        display: flex;
        margin-bottom: 10px;
        color: block;
        font-size: 14px;
        /* margin-left: 10px; */
    }

    .van-uploader__upload-icon img {
        width: 100%;
        height: 100%;
    }

    .van-uploader__upload {
        width: 38vw;
        height: calc(50vw * 3 / 4);
        border: #50a7f4 1px dashed;
        border-radius: 8px;
        /* border: 1px dashed #bcbebe; */
        margin: 0 8px 0px 4px;
        background: url("../image/bg-3.png") no-repeat;
        background-size: 100% 100%;
        /* background: none !important; */
    }

    .upload_img {
        /* width: 44%; */
        width: 25vw;
        height: calc(34vw * 3 / 4);
        /* width: 120px; */
        /* border: #50a7f4 0.25px dashed; */
        /* height: 120px; */
        /* padding: 20px; */
        /* background: #ffffff; */
        /* border-radius: 8px; */
        /* border: 1px dashed #bcbebe; */
        display: flex;
        flex-direction: column;
        /* justify-content: space-around; */
        align-items: center;
        padding: 2px;
        position: relative;
        margin-top: 8px;
        /* margin-bottom: 10px; */
        float: left;
        box-sizing: border-box;
        background: url("../image/bg-3.png") no-repeat;
        background-size: 100% 100%;
    }

    .upload_img:nth-child(3n+2) {
        margin-right: 5%;
        margin-left: 5%;
    }

    .img_active {
        width: 28%;
        height: 80px;
        /* padding: 20px; */
        background: #ffffff;
        border-radius: 8px;
        opacity: 0;
    }

    .quxiao {
        position: absolute;
        right: -8%;
        top: -5%;
        display: block;
        width: 20%;
        height: 20%;
    }

    .chenggong {
        position: absolute;
        left: 38%;
        bottom: -6%;
        display: block;
        width: 28%;
        height: 20%;
    }

    .upimg {
        margin-top: 10px;
        width: 36px;
        height: 30px;
        background: url("../image/bg-1.png") no-repeat;
        background-size: 100% 100%;
    }

    .up_text {
        font-weight: 500;
        font-size: 12px;
        color: #969799;
    }

    .inp {
        display: inline-block;
    }

    input[type="text"] {
        width: 230px;
        height: 50px;
        margin-bottom: 0;
    }
    .title_right{
        font-size: 12px;
        margin-right: 10px;
    }
</style>
</head>

<body>
    <div class="box" id="app">
        <div class="is-loading">
            <div class="curtain">
              <div class="loadingBgc">
                <div class="loader"></div>
              </div>
            </div>
          </div>
        <div class="header_tit">
            <van-nav-bar title="问题反馈" left-arrow>
                <template #left>
                    <div class="back_l" @click="home"><img src="../image/left.png" alt=""></div>
                </template>
                <template #right>
                    <div class="title_right" @click="historyFeedback">查看历史反馈</div>
                </template>
            </van-nav-bar>
        </div>
        <div class="form-box">
            <!-- clearable -->
            <span class="numImg">问题描述</span>
            <van-field v-model="form.text" type="textarea" rows="8" maxlength="200" show-word-limit
                placeholder="hi~请详细描述你的使用场景，帮助我们更好的定位问题进行产品优化..." />
        </div>
        <div class="form-box" style="padding: 0px 15px;">
            <div class="header_upload1">
                <div class="text_title">
                    <span class="numImg">问题截图（最多上传2张图片，每张不超过10MB）</span>
                    </span>
                </div>
                <div class="upload_wrapper1">
                    <div class="upload_img" v-for="(item, index) in addedPreviewFile">
                        <img :src="item.localDatas" style="width: 100%; height: 100%" alt="" ref="img"
                            v-if="addedPreviewFile" />
                        <img @click="delImg(index)" v-if="addedPreviewFile" class="quxiao" src="../image/quxiao1.png"
                            alt="" />
                    </div>
                    <div class="upload_img" @click="functionBtn" v-if="addedPreviewFile.length < 2">
                        <input type="file" id="inputer" class="file-input4 file-input"
                            style="display: none; width: 28%; height: 100%" ref="inputer" />
                    </div>
                </div>
            </div>
        </div>
        <div class="form-box">
            <!-- required -->
            <van-field v-model="form.phone" label="手机号" placeholder="请输入手机号" clearable :label-width="80" />
        </div>
        <div class="form-box" style="padding-top:5px">
            <van-field v-model="form.email" label="邮箱" required placeholder="请输入邮箱" clearable :label-width="80" />
        </div>
        <div class="foot">
            <div class="foot_wrapper" :style="footStyle">
                <van-button :disabled="disabled" :style="buttonStyle" :loading="submitBtnLoading" type="primary"
                    @click="onSubmit()" round block color="#48b4b9">提 交</van-button>
            </div>
        </div>
    </div>
</body>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                form: {
                    text: '',
                    phone: '',
                    email: '',
                    newEmail: '',
                },
                isflageIOX: false,
                addedPreview: [], // 临时存储
                addedPreviewFile: [], // 最终存储
                addedPreviewFileIds: [],
                slocalResPath: [],
                localIds: [],
                batchId: "", //标识图片是否是同一批数据,
                id: null,
                multiple: true,
                // userDocid: null,
                formData: [],
                toMail: '',
                submitBtnLoading: false
            }
        },
        computed: {
            // && this.form.phone !== null && this.form.phone !== ''
            isFormNotEmpty() {
                return this.form.text !== null && this.form.text !== '' && this.form.email !== null && this.form
                    .email !== '';
            },
            buttonStyle() {
                if (this.isFormNotEmpty) {
                    return {
                        background: '#19AEB0',
                        borderColor: '#19AEB0'
                    }; // 当属性不为空时的样式  
                } else {
                    return {};
                }
            },
            footStyle() {
                if (this.isFormNotEmpty) {
                    return {
                        opacity: '100%'
                    };
                } else {
                    return {};
                }
            },
            disabled() {
                if (this.isFormNotEmpty) {
                    return false;
                } else {
                    return true;
                }
            }
        },
        created() {
            const _this = this;
            _this.compatibleInput();
            _this.toMail = sessionStorage.getItem("toMail")
            if (_this.toMail && _this.toMail !== 'null') {
                _this.form.email = _this.toMail
            }
            $.getScript("../js/jweixin-sgccigw-1.0.0.js" /*"js/jweixin-1.0.0.js"*/ , function () {
                let jsApiList = [];
                wx.ready(function () {
                    wx.onHistoryBack(() => {
                        _this.home()
                        // alert(999)
                        return false
                    })
                });
                jsApiList = [
                    'onHistoryBack',
                    "chooseImage",
                    "getLocalImgData",
                    "previewImage",
                    "uploadImage",
                    "downloadImage",
                    "previewFile",
                    "startRecord",
                    "stopRecord",
                ];
                wx.config({
                    beta: true,
                    debug: false,
                    appId: "ww4d11a39991ebffdc",
                    timestamp: '1639582452',
                    nonceStr: "AMQGnmTMzhJetshY",
                    signature: 'fb9f560a9b4824f7db3525926994010de74ea055',
                    jsApiList: jsApiList
                });
            });
        },
        methods: {
            // 判断安卓还是ios
            compatibleInput() {
                //获取浏览器的userAgent,并转化为小写
                var ua = navigator.userAgent.toLowerCase();
                //判断是否是苹果手机，是则是true
                var isIos = ua.indexOf("iphone") != -1 || ua.indexOf("ipad") != -1;
                if (isIos) {
                    this.isflageIOX = true;
                } else {
                    this.isflageIOX = false;
                }
            },
            delImg(index) {
          // 1: 取要删除的id
          const delid = this.addedPreviewFileIds[index];
          // 删除addedPreviewFile index
          this.delfile(delid, index);
        },
        delfile(id, index) {
          let AuthenticationSession =
            sessionStorage.getItem("Authentication");
          if (sessionStorage.getItem("iscp_port")) {
            iscp_port = sessionStorage.getItem("iscp_port");
          } else {
            iscp_port = "";
          }
          let data = {
            ids: id,
            timestamp: new Date().getTime() + "", //时间戳
          };
          data = JSON.stringify(data);
          let sign = sm3(data);
          $.ajax({
            url: localUrlLink + iscp_port + "/tjAiAssistant/storage/deleteImage",
            type: "post",
            async: false, //是否同步，false表示同步请求
            dataType: "json",
            data: data,
            headers: {
              "Content-Type": "application/json;charset=UTF-8",
              Authentication: AuthenticationSession,
              sign: sign,
            },
            success: (res, txt, xhr) => {
              if (sm3(res.resultValueStr) == xhr.getResponseHeader("sign")) {
                let Authentication = xhr.getResponseHeader("Authentication");
                if (res.code == 200) {
                  if (Authentication) {
                    sessionStorage.setItem("Authentication", Authentication);
                    //    成功
                    mui.toast(res.resultValue, {
                      duration: 1000,
                      type: "div",
                    });
                    this.addedPreview.splice(index, 1);
                    this.addedPreviewFile.splice(index, 1);
                    this.addedPreviewFileIds.splice(index, 1);
                  }
                } else {
                  mui.toast(res.resultValue, {
                    duration: "long",
                    type: "div",
                  });
                }
              }
            },
            error: function (e) {
              $(".curtain").css("display", "none");
              mui.toast("请求异常请稍后再试", {
                duration: "long",
                type: "div",
              });
            },
          });
        },
            functionBtn() {
                var count = 2 - this.addedPreviewFile.length;
                var count1 = "";
                if (count < 2) {
                    count1 = 2 - this.addedPreviewFile.length;
                } else {
                    count1 = 2;
                }
                wx.chooseImage({
                    count: count1,
                    sizeType: ["original"], // 可以指定是原图还是压缩图，默认二者都有
                    sourceType: ["album", "camera"], // 可以指定来源是相册还是相机，默认二者都有
                    quality: 1, //压缩质量，范围0～1，数值越小，质量越低，压缩率越高（仅对jpg有效）
                    success: (res) => {
                        console.log('chooseImage---res', res)
                        // var localIds = res.localIds[0]; // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
                        this.slocalResPath = [];
                        $(".curtain").css("display", "block");
                        var exists = this.addedPreviewFile.length;
                        // 先把数组长度固定
                        this.addedPreview.length = exists + res.localIds.length;
                        this.loopList(res.localIds, exists, 0);
                    },
                });
            },
            loopList(localIds, exists, index) {
                var loid = localIds[index];
                wx.invoke(
                    "getLocalResPath", {
                        localId: loid,
                    },
                    (res) => {
                        console.log(res, "getLocalResPath");
                        this.slocalResPath.push({
                            path: res.localResPath
                        });
                        this.getImage(res.localResPath, exists + index, loid, () => {
                            if (index === localIds.length - 1) {
                                console.log(1196, "this.checkListAndroid");
                                if (this.isflageIOX) {
                                    this.checkList("ios");
                                } else {
                                    this.checkList("Android");
                                }
                            } else {
                                this.loopList(localIds, exists, index + 1);
                            }
                        });
                    }
                );
            },
            getImage(slocalResPath, index, localIds, callback) {
                wx.invoke(
                    "ext_FileManager_Information", {
                        data: {
                            path: slocalResPath,
                        },
                    },
                    (res) => {
                        let str = JSON.parse(res.data);
                        str = str.fileSize.split(".");
                        console.log(str, "size大小")
                        if (str[1].indexOf("MB") !== -1) {
                            if (Number(str[0]) >= 10) {
                                $(".curtain").css("display", "none");
                                mui.toast("图片大小不能超过10MB", {
                                    duration: "long",
                                    type: "div",
                                });
                                this.addedPreview.length--;
                                return;

                                // this.addedPreview[index] = {
                                //   error: '图片大小不能超过15MB'
                                // }
                                // callback()
                            } else {
                                if (this.isflageIOX) {
                                    this.getImgBase(localIds, index, callback, slocalResPath, Number(str[
                                        0]));
                                } else {
                                    this.addedPreview[index] = {
                                        localDatas: slocalResPath,
                                        size: Number(str[0]),
                                    };
                                    callback();
                                }
                                // callback()
                                // this.getImgBase(localIds, index, callback);
                            }
                        } else {
                            console.log(localIds, "123");
                            if (this.isflageIOX) {
                                this.getImgBase(localIds, index, callback, slocalResPath, 1);
                            } else {
                                this.addedPreview[index] = {
                                    localDatas: slocalResPath,
                                    size: 1,
                                };

                                callback();
                            }
                            // callback()
                            // this.getImgBase(localIds, index, callback);
                        }
                    }
                );
            },
            getImgBase(localIds, index, callback, slocalResPath, size) {
                var a = false;
                // 根据id取图片的路径
                wx.getLocalImgData({
                    localId: localIds,
                    success: (res) => {
                        var localData = res.localData;
                        if (localData.indexOf("data:image") != 0) {
                            //判断是否有这样的头部
                            localData = "data:image/jpeg;base64," + localData;
                        }
                        localData = localData
                            .replace(/\r|\n/g, "")
                            .replace("data:image/jpg", "data:image/jpeg");
                        // 第一个替换的是换行符，第二个替换的是图片类型，因为在IOS机上测试时看到它的图片类型时jgp，
                        // 这不知道时什么格式的图片，为了兼容其他设备就把它转为jpeg
                        this.addedPreview[index] = {
                            localDatas: localData,
                            path: slocalResPath,
                            size: size
                        }; // 返回图片的服务器端ID
                        // ios单独添加文件用来回显
                        this.slocalResPath.forEach(el => {
                            if (el.path == slocalResPath) el.file = localData
                        });
                        // console.log('getImgBase',this.addedPreview)
                        callback();
                    },
                });
            },
            async checkList(ios) {
                if (sessionStorage.getItem("iscp_port")) {
                    iscp_port = sessionStorage.getItem("iscp_port");
                } else {
                    iscp_port = "";
                }
                console.log(this.slocalResPath, "进入checkList");

                const userId = sessionStorage.getItem("userId");
                const orgId = sessionStorage.getItem("unitId");
                const regEx = ".+/(.+)$";
                var datas = {
                        cellphone: ios,
                        orgId: orgId,
                        userId: userId,
                        batchId: this.batchId,
                        files: {},
                    },
                    file = {};
                // 遍历img数组 单张上传图片
                for (let i = 0; i < this.slocalResPath.length; i++) {
                    datas.filename1 = this.slocalResPath[i].path.match(regEx)[0];
                    datas.originalname1 = this.slocalResPath[i].path.match(regEx)[0];
                    datas.files.file1 = this.slocalResPath[i].path;
                    try {
                        var resultValue = await this.extNetUpload(datas);
                        resultValue = JSON.parse(resultValue)
                        if (sm3(resultValue.id) == resultValue.sign) {
                            let Authentication = resultValue.Authentication;
                            if (Authentication) {
                                sessionStorage.setItem("Authentication", Authentication);
                                // this.batchId = resultValue.batchId
                                ids = resultValue.id.split(",");
                                if (
                                    !this.addedPreviewFileIds ||
                                    this.addedPreviewFileIds.length == 0
                                ) {
                                    this.addedPreviewFileIds = [...ids];
                                } else {
                                    this.addedPreviewFileIds = [
                                        ...this.addedPreviewFileIds,
                                        ...ids,
                                    ];
                                }
                                // this.addedPreviewFile = [];
                                // if (!this.addedPreviewFile.length) {
                                //   this.addedPreviewFile = this.addedPreview;
                                // } else {
                                //   this.addedPreview.forEach((item) => {
                                //     this.addedPreviewFile.push(item);
                                //   });
                                // }
                                // if(this.isflageIOX){
                                //   this.addedPreviewFile.push(this.slocalResPath[i].file)
                                // }else{
                                //   this.addedPreviewFile.push(this.slocalResPath[i].path)
                                // }

                                this.addedPreviewFile.push({
                                    localDatas: this.isflageIOX ? this.slocalResPath[i].file : this
                                        .slocalResPath[i].path
                                })
                                console.log('this.addedPreviewFile', this.addedPreviewFile)
                                console.log('this.slocalResPath', this.slocalResPath)
                            }
                        } else {
                            mui.toast("完整性校验失败", {
                                duration: "long",
                                type: "div",
                            });
                        }
                        // console.log('success', res)
                    } catch (error) {
                        // 删掉数组中上传失败的图片
                        this.addedPreview = this.addedPreview.filter(el => el.localDatas != this
                            .slocalResPath[i]);

                        mui.toast(`上传失败，请稍后再试！`, {
                            duration: "long",
                            type: "div",
                        });
                    }
                }
                $(".curtain").css("display", "none");
            },
            createNonceStr(len) {
          var e = len ? len : 16;
          var t =
            "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
            a = t.length,
            n = "";
          for (i = 0; i < e; i++)
            n += t.charAt(Math.floor(Math.random() * a));
          return n;
        },
            extNetUpload(datas) {
                console.log(datas,888)
                return new Promise((resolve, reject) => {
                    var channelId = "net_upload_" + this.createNonceStr(8);
                    const timestamp = new Date().getTime() + "";
                    let signTime = sm3(timestamp + "&" + datas.userId);
                    let AuthenticationSession =
                        sessionStorage.getItem("Authentication");
                    var param = {
                        id: channelId,
                        timeout: "60",
                        url: localUrlLink +
                            iscp_port +
                            "/tjAiAssistant/storage/uploading2",
                        header: {
                            "Content-Type": "application/json;charset=UTF-8",
                            sign: signTime,
                            Authentication: AuthenticationSession,
                            timestamp: timestamp,
                            userId: datas.userId,
                        },
                        data: datas,
                        files: datas.files,
                    };
                    console.log("ext_Net_Upload---param", param);
                    wx.invoke(
                        "ext_Net_Upload", {
                            data: param,
                        },
                        (res) => {
                            res.datas = datas
                            console.log('ext_Net_Upload--res', res)
                            if (res.err_msg.endsWith(":ok")) {
                                //成功结果
                                const result = JSON.parse(res.result);
                                if (result.code == 200) {
                                    return resolve(result.resultValue);
                                }
                                return reject(result);
                            }
                            return reject(res);
                        }
                    );
                });
            },
            home() {
                $(location).attr("href", "Home.html");
            },
            historyFeedback() {
                $(location).attr("href", "feedbackHistory.html");
            },
            onSubmit() {
                if (this.form.text.split(" ").join("").length == 0) {
                    mui.toast('详细描述不能为空', {
                        duration: 'long',
                        type: 'div'
                    })
                    return
                }
                  if (!this.form.phone || this.form.phone.split(" ").join("").length == 0) {
                    //   mui.toast('手机号不能为空', {
                    //       duration: 'long',
                    //       type: 'div'
                    //   })
                    //   return
                  } else {
                    if (!(/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1589]))\d{8}$/
                        .test(this.form.phone))) {
                    mui.toast('手机号格式错误', {
                        duration: 'long',
                        type: 'div'
                    })
                    return
                }
                  }
                
               
                if (!this.form.email || this.form.email.split(" ").join("").length == 0) {
                    mui.toast('邮箱不能为空', {
                        duration: 'long',
                        type: 'div'
                    })
                    return
                }
                if (!(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
                        .test(this.form.email))) {
                    mui.toast('邮箱格式错误', {
                        duration: 'long',
                        type: 'div'
                    })
                    return
                }

                if (sessionStorage.getItem("iscp_port")) {
                    iscp_port = sessionStorage.getItem("iscp_port");
                } else {
                    iscp_port = ""
                }
       
                //判断用户初始邮箱是否被改过
                if (this.toMail != this.form.email) {
                    this.form.newEmail = this.form.email
                }
                const orgId = sessionStorage.getItem("unitId");
                userId = sessionStorage.getItem("userId");
                let data = {
                    userId: userId,
                    orgId: orgId,
                    attachmentIds:this.addedPreviewFileIds.join(","),
                    text: this.form.text,
                    phone: sm2.doEncrypt(this.form.phone, sessionStorage.getItem("bpuk"), 1),
                    email: sm2.doEncrypt(this.form.email, sessionStorage.getItem("bpuk"), 1),
                    newEmail: this.form.newEmail ? sm2.doEncrypt(this.form.newEmail, sessionStorage.getItem("bpuk"), 1) : sm2.doEncrypt(this.form.email, sessionStorage.getItem("bpuk"), 1),
                };
                let AuthenticationSession = sessionStorage.getItem("Authentication");
                data = JSON.stringify(data)
                let sign = sm3(data);
                this.submitBtnLoading = true
                $.ajax({
                    url: localUrlLink + iscp_port + "/tjAiAssistant/defect/DefectSendMail",
                    type: "post",
                    async: false, //是否同步，false表示同步请求
                    dataType: "json",
                    data: data,
                    timeout: 5000, //超时时间设置，单位毫秒
                    headers: {
                        "Content-Type": "application/json;charset=UTF-8",
                        Authentication: AuthenticationSession,
                        sign: sign
                    },
                    success: (res) => {
                        console.log('res', res)
                        if (res.code == 200) {
                            mui.toast("操作成功", {
                                duration: "long",
                                type: "div"
                            });
                            this.form = this.$options.data().form;
                            this.addedPreview = [];
                            this.addedPreviewFile = [];
                            this.addedPreviewFileIds = [];
                        } else if (res.code == 500) {
                            mui.toast(res.resultValue, {
                                duration: "long",
                                type: "div",
                            });
                        } else {
                            mui.toast("请求超时请稍后再试", {
                                duration: "long",
                                type: "div",
                            });
                        }
                        this.submitBtnLoading = false
                    },
                    error: (e) => {
                        this.submitBtnLoading = false
                        mui.toast('请求异常,请稍后再试', {
                            duration: 'long',
                            type: 'div'
                        })
                    },
                });
            },
        }
    })
</script>

</html>